﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Control_layer;
using System.IO;

namespace TestProject
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        UC_login login = new UC_login();
        
        

        private void bt_LogIn_Click(object sender, EventArgs e)
        {
            //UC_login login = new UC_login (cb_server.Text, tb_account.Text, tb_user.Text, tb_wachtwoord.Text);

        }

        

        //public FileInfo[] GetFiles()
        //{
        //    byte[] bytes = login.GetBytesFromFile();
        //    //FileInfo[] filesInfo = login.getFiles();
        //    dataGridView1.Columns.Add("fileFormat", "fileFormat");
        //    dataGridView1.Columns.Add("fileName", "fileName");
        //    dataGridView1.Columns.Add("Directory", "Directory");
        //    dataGridView1.Columns.Add("bytes","bytes");
        //    foreach (FileInfo files in filesInfo)
        //    {              
        //        dataGridView1.Rows.Add(files.Extension, Path.GetFileNameWithoutExtension(files.Name), files.DirectoryName, bytes);

        //    }           
        //    return filesInfo;
        //}

        //public byte[] GetBytesFromFile()
        //{
            // this method is limited to 2^32 byte files (4.2 GB)

            
            //dataGridView1.Columns.Add("bytes", "bytes");
            //foreach (byte fileBytes in bytes)
            //{
            //    dataGridView1.Rows.Add(bytes);
            //}
            //return bytes;
        //}
        //public byte[] getFile()
        //{
        
            
        //}

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //GetFiles();
        }

        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
            System.Diagnostics.Process.Start(dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[2].Value.ToString() + dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[1].Value.ToString() + dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[0].Value.ToString());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            login.AddFileInfo();
        }
    }

}
